package com.company.blog.model.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDateTime;
import java.util.List;

//@Getter
//@Setter
@NoArgsConstructor
@ToString
public class Blog implements Serializable {

    private Long id;
    private String photo;    //首图
    private String title;   //标题
    private String content;     //内容
    private String flag;    //标记(原创，转载...)
    private Boolean opengood;   //是否开启赞赏功能
    private Boolean openstatement;     //是否开启个人声明
    private Boolean opencomment;    //是否开启评论功能
    private Boolean recommend;  //是否设置为推荐文章
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;   //创建博客的时间
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateTime;   //修改博客的时间
    private String description;     //博客基本描述
    private Long pageViews;     //阅读量

    private Long userId;    //设置用户索引
    private long typeId;    //设置分类索引
    private String tagsName;  //设置多个标签索引

    private Type type;
    private List<Tag> tags;
    private User user;

    private List<Comment> comments;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getPhoto() {
        return photo;
    }

    public void setPhoto(String photo) {
        this.photo = photo;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public String getFlag() {
        return flag;
    }

    public void setFlag(String flag) {
        this.flag = flag;
    }

    public Boolean getOpengood() {
        return opengood;
    }

    public void setOpengood(Boolean opengood) {
        this.opengood = opengood;
    }

    public Boolean getOpenstatement() {
        return openstatement;
    }

    public void setOpenstatement(Boolean openstatement) {
        this.openstatement = openstatement;
    }

    public Boolean getOpencomment() {
        return opencomment;
    }

    public void setOpencomment(Boolean opencomment) {
        this.opencomment = opencomment;
    }

    public Boolean getRecommend() {
        return recommend;
    }

    public void setRecommend(Boolean recommend) {
        this.recommend = recommend;
    }

    public LocalDateTime getCreateTime() {
        return createTime;
    }

    public void setCreateTime(LocalDateTime createTime) {
        this.createTime = createTime;
    }

    public LocalDateTime getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(LocalDateTime updateTime) {
        this.updateTime = updateTime;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public Long getPageViews() {
        return pageViews;
    }

    public void setPageViews(Long pageViews) {
        this.pageViews = pageViews;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public long getTypeId() {
        return typeId;
    }

    public void setTypeId(long typeId) {
        this.typeId = typeId;
    }

    public String getTagsName() {
        return tagsName;
    }

    public void setTagsName(String tagsName) {
        this.tagsName = tagsName;
    }

    public Type getType() {
        return type;
    }

    public void setType(Type type) {
        this.type = type;
    }

    public List<Tag> getTags() {
        return tags;
    }

    public void setTags(List<Tag> tags) {
        this.tags = tags;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public List<Comment> getComments() {
        return comments;
    }

    public void setComments(List<Comment> comments) {
        this.comments = comments;
    }
}
